package com.cugmarket.controller.order;

import com.cugmarket.dto.Result;
import com.cugmarket.service.VoucherOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/voucher-order")
public class VoucherOrderController {
    @Resource
    private VoucherOrderService voucherOrderService;
    @PostMapping("/sekill")
    public Result sekillVoucher(@RequestParam("id") String voucherId) {
        String orderId = voucherOrderService.sekillVoucher(voucherId);
        return Result.success(orderId);
    }
}
